package pe.gob.mpfn.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pe.gob.mpfn.model.Informe;


@Service
@Transactional
public class InformeServiceImpl implements InformeService {

	public long countAllInformes() {
        return Informe.countInformes();
    }

	public void deleteInforme(Informe informe) {
        informe.remove();
    }

	public Informe findInforme(Integer id) {
        return Informe.findInforme(id);
    }

	public List<Informe> findAllInformes() {
        return Informe.findAllInformes();
    }

	public List<Informe> findInformeEntries(int firstResult, int maxResults) {
        return Informe.findInformeEntries(firstResult, maxResults);
    }

	public void saveInforme(Informe informe) {
        informe.persist();
    }

	public Informe updateInforme(Informe informe) {
        return informe.merge();
    }
}
